home *** CD-ROM | disk | FTP | other *** search
- // Copyright (C) 1997-2002 Alias|Wavefront,
- // a division of Silicon Graphics Limited.
- //
- // The information in this file is provided for the exclusive use of the
- // licensees of Alias|Wavefront. Such users have the right to use, modify,
- // and incorporate this code into other products for purposes authorized
- // by the Alias|Wavefront license agreement, without fee.
- //
- // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- // PERFORMANCE OF THIS SOFTWARE.
- //
- //
- // Alias|Wavefront Script File
- // MODIFY THIS AT YOUR OWN RISK
- //
- // Creation Date: Nov, 1999
- // Author: bb
- //
- // Procedure Name:
- // doDuplicateClipArgList
- //
- // Description:
- // Duplicate a clip
- //
- // Input Arguments:
- // $version: The version of this option box. Used to know how to
- // interpret the $args array.
- //
- // $args
- // Version 1
- // [0] $name: name of the baked clip
- // [1] $editor : editor containing the clip
- // [2] $keep : 0 = put merged version in trax
- // 1 = put merged version in visor
- //
- global proc
- doMergeClipArgList( string $version, string $args[] )
- {
- string $mergeName = $args[0];
- string $clipEd = $args[1];
- int $keep = $args[2];
-
- if (size($clipEd) == 0) {
- error ("Could not find the clipEditor: " + $clipEd);
- return;
- }
-
- string $cmd;
- string $selectedClips[] = `clipEditor -q -sc $clipEd`;
- string $selectedBlends[] = `clipEditor -q -sb $clipEd`;
-
- int $nClips = `size($selectedClips)`;
- int $nBlends = `size($selectedBlends)`;
-
- if (0 == $nClips && 0 == $nBlends) {
- error("No clips or blends are selected.");
- return;
- }
-
- // The first thing to check is that the clips and blends all have the
- // same scheduler.
- //
- string $scheduler = "";
- int $ii = 0;
- for ($ii = 0; $ii < $nClips; $ii+=2) {
- if ($ii == 0) {
- $scheduler = $selectedClips[0];
- continue;
- }
-
- if ($selectedClips[$ii] != $scheduler) {
- error("All selected clips must be on the same character.");
- }
- }
-
- // Only the first blend can be passed to the bakeClip command.
- // Blends are automatically included when both their clips are selected.
- //
- if ($nBlends > 0) {
- if ($scheduler == "") {
- $scheduler = $selectedBlends[0];
- } else {
- if ($scheduler != $selectedBlends[0]) {
- error("All selected clips and blends must be on the same character.");
- return;
- }
- }
- }
-
- // Create the command.
- //
- string $bakeClipCmd = "bakeClip ";
- string $clipPart = "";
-
- for ($ii = 0; $ii < $nClips; $ii+=2) {
- $clipPart += ("-ci " + $selectedClips[$ii+1] + " ");
- }
-
- $bakeClipCmd += $clipPart;
-
- string $blendPart = "";
- if ($nBlends > 0) {
- $blendPart =
- ("-b " + $selectedBlends[1] + " " + $selectedBlends[2] + " ");
- }
-
- $bakeClipCmd += $blendPart;
-
- // Check for -keepOriginals toggle
- //
- if ($keep)
- $bakeClipCmd += " -k ";
-
- if ($mergeName != "") {
- $bakeClipCmd += ("-name "+$mergeName+" ");
- }
-
- string $character[] = `clipSchedule -q -ch $scheduler`;
-
- $bakeClipCmd += $character[0];
- eval($bakeClipCmd);
- }
-